<?php
/**
 * Created By Project
 * Author: 陈东
 * Copyright：陈东
 * Source Code：陈东
 * Explain：I shall not authorize for any other commercial purposes, law breakers must be prosecuted.
 */
namespace Home\Controller;
use Think\Controller;

class JingController extends BaseController {
	
	public function index(){
		
		$d = D(C('TABLE_JPRO'));
		$result = $d->select();
		foreach ($result as &$r){
			$r['cishu'] = rand(10000,13000);
		}
		$this->assign('result',$result);
		$this->display();
	}
	
	public function preachlist(){
		$id = I('get.id',0);
		if($id){
			$d = D(C('TABLE_JPRO'));
			$proresult = $d->find($id);
			
			$d = D(C('TABLE_JIANGJING'));
			$listresult = $d->where(array('pid'=>$id))->select();
			
			$this->assign('proresult',$proresult);
			$this->assign('listresult',$listresult);
			if(empty($listresult)){
				$this->assign('emptyresult',0);
			}
			$this->display();
		}else{
			$this->error('参数错误','',1);
		}
		
	}

}